FILESEXTRAPATHS_prepend := "${THISDIR}/imx-mkimage:"

SRC_URI_append += "file://0001-imx8mp-Add-support-platform-for-DDR4-AIROBOT.patch"
SRC_URI_append += "file://0001-imx8mp-Reuse-imx8mpddr4evk-ddr-firmware-for-airobot.patch"

do_compile_preppend () {
    make_file=${S}/iMX8M/soc.mak
    if [ -e ${make_file} ]; then
#        sed -i "s/dtbs = .*dtb/dtbs = ${UBOOT_DTB_NAME}/g" ${make_file}
        sed -i "s/dtbs_ddr4_evk = .*dtb/dtbs_ddr4_evk = ${UBOOT_DTB_NAME}/g" ${make_file}
    fi
}

addtask compile_preppend before do_compile after do_configure

COMPATIBLE_MACHINE = "(imx8mp-ddr4-ipc)"
